<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gemba Labs</title>
	<atom:link href="https://www.gembalabs.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.gembalabs.com/</link>
	<description></description>
	<lastBuildDate>Sun, 08 Apr 2018 20:12:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Fixing common high-resolution scaling issues for Windows 10 applications</title>
		<link>https://www.gembalabs.com/2018/04/08/fixing-common-high-resolution-scaling-issues-for-windows-10-applications/</link>
					<comments>https://www.gembalabs.com/2018/04/08/fixing-common-high-resolution-scaling-issues-for-windows-10-applications/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Sun, 08 Apr 2018 20:12:42 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=490</guid>

					<description><![CDATA[<p>If you've spent any time on a newer, high resolution Windows 10 machine I'm sure you've come across many applications that don't quite scale right. For example, at the recommended high-resolution settings on my Surface Book, SoapUI is pretty much unusable. Turns out that you can apply a setting to applications that force them</p>
<p>The post <a href="https://www.gembalabs.com/2018/04/08/fixing-common-high-resolution-scaling-issues-for-windows-10-applications/">Fixing common high-resolution scaling issues for Windows 10 applications</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="fusion-fullwidth fullwidth-box nonhundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-1 fusion-one-full fusion-column-first fusion-column-last 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						<div class="fusion-text"><p>If you&#8217;ve spent any time on a newer, high resolution Windows 10 machine I&#8217;m sure you&#8217;ve come across many applications that don&#8217;t quite scale right. For example, at the recommended high-resolution settings on my Surface Book, SoapUI is pretty much unusable. Turns out that you can apply a setting to applications that force them to use system scaling.</p>
<p>Right-click the .exe and select properties. From there go to the Compatibility tab and apply the settings below.</p>
<p><img fetchpriority="high" decoding="async" class=" wp-image-492 alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-779x1024.png" alt="" width="516" height="678" srcset="https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-200x263.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-228x300.png 228w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-400x526.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-600x789.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-768x1010.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-779x1024.png 779w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix-800x1052.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/04/win10-resolution-fix.png 812w" sizes="(max-width: 516px) 100vw, 516px" /></p>
<p>Hope this helps someone else!</p>
</div><div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2018/04/08/fixing-common-high-resolution-scaling-issues-for-windows-10-applications/">Fixing common high-resolution scaling issues for Windows 10 applications</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2018/04/08/fixing-common-high-resolution-scaling-issues-for-windows-10-applications/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating Secure Volumes on Windows 10</title>
		<link>https://www.gembalabs.com/2018/04/08/creating-secure-volumes-on-windows-10/</link>
					<comments>https://www.gembalabs.com/2018/04/08/creating-secure-volumes-on-windows-10/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Sun, 08 Apr 2018 17:22:46 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=421</guid>

					<description><![CDATA[<p>A feature of OSX that I appreciated was the ability to create a secured volume for storing personal documents. Since converting to Windows 10, I've found you can get the same feature using Bitlocker. I already have hard drive encryption enabled which gives you that first level of security, but having a password-protected volume</p>
<p>The post <a href="https://www.gembalabs.com/2018/04/08/creating-secure-volumes-on-windows-10/">Creating Secure Volumes on Windows 10</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="fusion-fullwidth fullwidth-box nonhundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-2 fusion-one-full fusion-column-first fusion-column-last 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						<div class="fusion-text"><p>A feature of OSX that I appreciated was the ability to create a secured volume for storing personal documents. Since converting to Windows 10, I&#8217;ve found you can get the same feature using Bitlocker. I already have hard drive encryption enabled which gives you that first level of security, but having a password-protected volume on top for sensitive documents is even better.</p>
<p>To start, we need to create a VHD (virtual hard drive) by opening the Disk Management utility and selecting &#8216;Create VHD&#8217; from the Action menu.</p>
<p><img decoding="async" class="alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/01/select-create-vhd-1024x787.png" alt="" width="777" height="597" /></p>
<p>Next we need to configure a few settings for our VHD. Click the Browse button and choose a location and filename for your drive. Then specify the disk size. Since I&#8217;m only storing PDFs and spreadsheets, I&#8217;m going to make this one relatively small at 2GB. The standard VHD format will be fine and since I want optimal read\write performance I&#8217;m going to choose the fixed size hard drive type. This will cause the VHD file to consume the full allocated size on your physical hard drive. Alternatively, you can configure it dynamically expand which will allow it to grow to the maximum size as you add data to it. Good choice if you&#8217;re limited on hard drive space and not concerned about performance.</p>
<p><img decoding="async" class=" wp-image-432 alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties.png" alt="" width="510" height="635" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties-200x249.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties-241x300.png 241w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties-400x498.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties-600x748.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-drive-properties.png 760w" sizes="(max-width: 510px) 100vw, 510px" /></p>
<p>This will create a new disk in the management utility. Right click the disk name (&#8216;Disk 1&#8217; in my case) and select &#8216;Initialize Disk&#8217;. The default settings in the initialization window will work for us, go ahead and click OK.</p>
<p><img loading="lazy" decoding="async" class=" wp-image-426 alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-1024x826.png" alt="" width="650" height="524" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-177x142.png 177w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-200x161.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-300x242.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-400x323.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-600x484.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-768x620.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-800x646.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-1024x826.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk-1200x968.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialize-disk.png 1492w" sizes="auto, (max-width: 650px) 100vw, 650px" /></p>
<p><img loading="lazy" decoding="async" class=" wp-image-425 alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-1024x809.png" alt="" width="648" height="512" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-200x158.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-300x237.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-400x316.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-600x474.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-768x607.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-800x632.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-1024x809.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties-1200x948.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/initialization-properties.png 1412w" sizes="auto, (max-width: 648px) 100vw, 648px" /></p>
<p>Now that the disk has been initialized, we need to create a volume on it. Do that by right-clicking the &#8216;Unallocated&#8217; disk block and select &#8216;New Simple Volume&#8217;. This will walk you through a wizard to configure the volume. For our purposes, we&#8217;ll want to format the drive as NTFS and give it a volume label.</p>
<p><img loading="lazy" decoding="async" class=" wp-image-430 alignnone" src="http://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-1024x824.png" alt="" width="656" height="527" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-177x142.png 177w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-200x161.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-300x242.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-400x322.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-600x483.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-768x618.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-800x644.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-1024x824.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume-1200x966.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/select-new-simple-volume.png 1503w" sizes="auto, (max-width: 656px) 100vw, 656px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-436" src="http://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1.png" alt="" width="656" height="510" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-200x155.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-300x233.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-400x311.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-600x466.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-768x597.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1-800x622.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-1.png 992w" sizes="auto, (max-width: 656px) 100vw, 656px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-437" src="http://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2.png" alt="" width="656" height="509" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-200x155.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-300x233.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-400x310.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-600x465.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-768x596.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2-800x620.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-2.png 1002w" sizes="auto, (max-width: 656px) 100vw, 656px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-438" src="http://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3.png" alt="" width="657" height="516" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-200x157.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-300x236.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-400x314.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-600x471.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-768x603.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3-800x628.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-3.png 1001w" sizes="auto, (max-width: 657px) 100vw, 657px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-439" src="http://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-4.png" alt="" width="654" height="523" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-440" src="http://www.gembalabs.com/wp-content/uploads/2018/01/vol-wizard-5.png" alt="" width="656" height="510" /></p>
<p>Once it&#8217;s complete, an explorer window will appear listing our new disk.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-441" src="http://www.gembalabs.com/wp-content/uploads/2018/01/windows-explorer-drive.png" alt="" width="264" height="488" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/windows-explorer-drive-163x300.png 163w, https://www.gembalabs.com/wp-content/uploads/2018/01/windows-explorer-drive-200x369.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/windows-explorer-drive.png 357w" sizes="auto, (max-width: 264px) 100vw, 264px" /></p>
<p>Next we need to enable Bitlocker on the disk by right-clicking the disk and selecting &#8216;Turn on Bitlocker&#8217;. Specify a password for the drive and click next.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-435" src="http://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker-438x1024.png" alt="" width="335" height="783" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker-128x300.png 128w, https://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker-200x468.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker-400x936.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker-438x1024.png 438w, https://www.gembalabs.com/wp-content/uploads/2018/01/turn-on-bitlocker.png 591w" sizes="auto, (max-width: 335px) 100vw, 335px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-431" src="http://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-1024x797.png" alt="" width="658" height="512" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-200x156.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-300x234.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-400x311.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-600x467.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-768x598.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-800x623.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-1024x797.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password-1200x934.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-bitlocker-password.png 1237w" sizes="auto, (max-width: 658px) 100vw, 658px" /></p>
<p>If you forget your password, you can still access your drive using the generated recovery key. You&#8217;ll need to save the key before moving on. If you have Bitlocker encryption enabled for your physical hard drive, you won&#8217;t be able to save it as a file on that drive. But you can choose to print the recovery key as a PDF within the print dialog window.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-428" src="http://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-1024x810.png" alt="" width="651" height="515" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-200x158.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-300x237.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-400x316.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-600x475.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-768x607.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-800x633.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-1024x810.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key-1200x949.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/save-recovery-key.png 1239w" sizes="auto, (max-width: 651px) 100vw, 651px" /></p>
<p>Last you&#8217;ll need to set the encryption mode. Since this drive will only be used on this device, we&#8217;ll select &#8216;New encryption mode&#8217; since it provides the best level of encryption.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-433" src="http://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-1024x801.png" alt="" width="667" height="522" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-200x156.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-300x235.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-400x313.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-600x469.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-768x601.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-800x626.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-1024x801.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode-1200x938.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/set-encryption-mode.png 1225w" sizes="auto, (max-width: 667px) 100vw, 667px" /></p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-434" src="http://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-1024x805.png" alt="" width="670" height="527" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-200x157.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-300x236.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-400x315.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-600x472.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-768x604.png 768w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-800x629.png 800w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-1024x805.png 1024w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting-1200x944.png 1200w, https://www.gembalabs.com/wp-content/uploads/2018/01/start-encrypting.png 1241w" sizes="auto, (max-width: 670px) 100vw, 670px" /></p>
<p>After the encryption process has completed we are ready to add our files to the drive. When we&#8217;re done working, we want to close it by right-clicking and selecting &#8216;Eject&#8217;.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-423" src="http://www.gembalabs.com/wp-content/uploads/2018/01/eject.png" alt="" width="315" height="252" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/eject-177x142.png 177w, https://www.gembalabs.com/wp-content/uploads/2018/01/eject-200x160.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/eject-300x240.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/eject-400x320.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/eject.png 552w" sizes="auto, (max-width: 315px) 100vw, 315px" /></p>
<p>To reopen the drive, double click on the VHD within Windows Explorer. It will reappear in your drive list but you will most likely get an error saying the drive is not accessible. Click OK to close the alert and then double-click the drive in your drive list.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-427" src="http://www.gembalabs.com/wp-content/uploads/2018/01/known-error.png" alt="" width="393" height="185" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/known-error-200x94.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/known-error-300x141.png 300w, https://www.gembalabs.com/wp-content/uploads/2018/01/known-error-400x188.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/known-error-600x283.png 600w, https://www.gembalabs.com/wp-content/uploads/2018/01/known-error.png 709w" sizes="auto, (max-width: 393px) 100vw, 393px" /></p>
<p>After entering your password you will be able to work in the drive folder again.</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-424" src="http://www.gembalabs.com/wp-content/uploads/2018/01/enter-bitlocker-password.png" alt="" width="239" height="337" srcset="https://www.gembalabs.com/wp-content/uploads/2018/01/enter-bitlocker-password-200x282.png 200w, https://www.gembalabs.com/wp-content/uploads/2018/01/enter-bitlocker-password-213x300.png 213w, https://www.gembalabs.com/wp-content/uploads/2018/01/enter-bitlocker-password-400x564.png 400w, https://www.gembalabs.com/wp-content/uploads/2018/01/enter-bitlocker-password.png 407w" sizes="auto, (max-width: 239px) 100vw, 239px" /></p>
<p>Bitlocker works great for most cases, but if your looking for more security options or need to need a solution that works on other platforms you may want to consider an alternative tool such as Veracrypt. But for my needs, the built in Bitlocker features are perfect.</p>
</div><div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2018/04/08/creating-secure-volumes-on-windows-10/">Creating Secure Volumes on Windows 10</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2018/04/08/creating-secure-volumes-on-windows-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Cross browser print image javascript</title>
		<link>https://www.gembalabs.com/2015/09/18/cross-browser-print-image-javascript/</link>
					<comments>https://www.gembalabs.com/2015/09/18/cross-browser-print-image-javascript/#comments</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Fri, 18 Sep 2015 14:00:32 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=412</guid>

					<description><![CDATA[<p>Hiding sections of a page when printing is a fairly common and trivial task with the help of a little css. For example, hiding a page header and footer only takes a few lines.  @media print { .header, .footer { display: none; } }  But what if you want to only print a</p>
<p>The post <a href="https://www.gembalabs.com/2015/09/18/cross-browser-print-image-javascript/">Cross browser print image javascript</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hiding sections of a page when printing is a fairly common and trivial task with the help of a little css. For example, hiding a page header and footer only takes a few lines.</p>
<div class="fusion-fullwidth fullwidth-box hundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-3 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[css]
@media print {<br />
    .header, .footer {<br />
        display: none;<br />
    }<br />
}[/css]
<p>But what if you want to only print a single element, such as an image? You could take the above approach to hide all other elements and only allow the image to be displayed. An alternative approach is to use a little javascript to open the image in a new window and immediately trigger the <code>window.print()</code> method.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-4 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[js]
$(&#8216;#print-btn&#8217;).click(function () {<br />
    printImage(&#8216;/path/to/image.png&#8217;);<br />
    return true;<br />
});</p>
<p>function printImage(imagePath) {<br />
    var width = $(window).width() * 0.9;<br />
    var height = $(window).height() * 0.9;<br />
    var content = &#8216;&lt;!DOCTYPE html&gt;&#8217; +<br />
                  &#8216;&lt;html&gt;&#8217; +<br />
                  &#8216;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&#8217; +<br />
                  &#8216;&lt;body onload=&quot;window.focus(); window.print(); window.close();&quot;&gt;&#8217; +<br />
                  &#8216;&lt;img src=&quot;&#8217; + imagePath + &#8216;&quot; style=&quot;width: 100%;&quot; /&gt;&#8217; +<br />
                  &#8216;&lt;/body&gt;&#8217; +<br />
                  &#8216;&lt;/html&gt;&#8217;;<br />
    var options = &quot;toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width=&quot; + width + &quot;,height=&quot; + height;<br />
    var printWindow = window.open(&#8221;, &#8216;print&#8217;, options);<br />
    printWindow.document.open();<br />
    printWindow.document.write(content);<br />
    printWindow.document.close();<br />
    printWindow.focus();<br />
}[/js]
<p>The above script opens a new (nearly fullscreen) window containing the image we want to print. Notice that the <code>body</code> tag has an <code>onload</code> attribute that set&#8217;s the window&#8217;s focus (needed to make IE happy), calls print, and immediately closes. This tells the window to close after the user exits the print dialog. Note that you could actually move the <code>print()</code> and <code>close()</code> calls to the parent window&#8217;s script, printWindow.print() and printWindow().close(). But I found that doing so caused Chrome to display the print window before the image had a chance to load, resulting in an empty page. The version seemed to pacify both Chrome and Internet Explorer.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2015/09/18/cross-browser-print-image-javascript/">Cross browser print image javascript</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2015/09/18/cross-browser-print-image-javascript/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>gulp clean Error: ENOENT, lstat</title>
		<link>https://www.gembalabs.com/2015/09/16/gulp-clean-error-enoent-lstat/</link>
					<comments>https://www.gembalabs.com/2015/09/16/gulp-clean-error-enoent-lstat/#comments</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Wed, 16 Sep 2015 13:44:32 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Gulp]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=406</guid>

					<description><![CDATA[<p>I have a gulp task that uses gulp-clean to wipe the contents of an output directory before other tasks are ran. It seemed to fail 50% of the time, throwing an exception with the message ‘Error: ENOENT, lstat ….’. The problem turned out to be my use of wildcards in the src. In the original</p>
<p>The post <a href="https://www.gembalabs.com/2015/09/16/gulp-clean-error-enoent-lstat/">gulp clean Error: ENOENT, lstat</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have a gulp task that uses <code>gulp-clean</code> to wipe the contents of an output directory before other tasks are ran. It seemed to fail 50% of the time, throwing an exception with the message <code>‘Error: ENOENT, lstat ….’</code>. The problem turned out to be my use of wildcards in the src.</p>
<p>In the original task below, gulp creates a list of all files and folders in the <code>/dist</code> folder and deletes each of them asynchronously.</p>
<div class="fusion-fullwidth fullwidth-box hundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-5 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
gulp.task(&#8216;clean&#8217;, function () {<br />
    return gulp.src(&#8216;./dist/**/*&#8217;, { read: false })<br />
        .pipe(clean({force: true}));<br />
});[/source]
<p>Given the below folder structure, it was attempting to delete the <code>dist/images/logo.png</code> entry after it had already deleted the <code>/dist/images</code> folder.</p>
<p>/dist <br />
/dist/images<br />
/dist/images/logo.png</p>
<p>The solution was to remove the /dist folder itself without wildcards.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-6 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
gulp.task(&#8216;clean&#8217;, function () {<br />
    return gulp.src(&#8216;./dist&#8217;, { read: false })<br />
        .pipe(clean({force: true}));<br />
});[/source]
<h2>Use <code>del</code> Instead</h2>
<p>As an aside, <code>gulp-clean</code> has been deprecated. It’s suggested replacement, <code>del</code> does seem to handle glob patterns as we would expect.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-7 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
gulp.task(&#8216;clean&#8217;, function () {<br />
    return del(&#8216;./dist/**/*&#8217;);<br />
});[/source]<div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2015/09/16/gulp-clean-error-enoent-lstat/">gulp clean Error: ENOENT, lstat</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2015/09/16/gulp-clean-error-enoent-lstat/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full</title>
		<link>https://www.gembalabs.com/2015/05/20/an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/</link>
					<comments>https://www.gembalabs.com/2015/05/20/an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Wed, 20 May 2015 12:30:28 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=401</guid>

					<description><![CDATA[<p>I recently ran into a scenario where our cucumber tests would fail on our build server if tests within other jobs were being ran simultaneously. About halfway through, a handful of tests would consistently with the error: An operation on a socket could not be performed because the system lacked sufficient buffer space or because</p>
<p>The post <a href="https://www.gembalabs.com/2015/05/20/an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/">An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I recently ran into a scenario where our cucumber tests would fail on our build server if tests within other jobs were being ran simultaneously. About halfway through, a handful of tests would consistently with the error:</p>
<p><code>An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. - connect(2) (Errno::ENOBUFS)</code></p>
<p>Cucumber uses Chromedriver to communicate with Chrome over TCP/IP, using a wide range of temporary ports on the server. If your run a <code>netstat -a</code> from the command line while it’s running, you can see the port allocation. After a request completes, the socket is ready to close and goes into <code>TIME_WAIT</code> status. This gives any trailing packets time to catch up before the door closes. By default, the server keeps the socket in <code>TIME_WAIT</code> status for 4 minutes and is unavailable for reuse during that time. </p>
<p>We had enough tests running in parallel that it was exhausting the available ports after 15 minutes. Our solution was to reduce the amount of time the server kept ports in <code>TIME_WAIT</code> status down to 30 seconds, which is more than reasonable for our build server.</p>
<p>To do this, open regedit and add a new DWORD entry named TcpTimedWaitDelay in the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters folder &#8211; giving it a DECIMAL value of 30. (Will require a reboot.)</p>
<p>Hopefully this saves someone else some time!</p>
<p><a href="http://www.outsystems.com/forums/discussion/6956/how-to-tune-the-tcp-ip-stack-for-high-volume-of-web-requests/" target="_blank">http://www.outsystems.com/forums/discussion/6956/how-to-tune-the-tcp-ip-stack-for-high-volume-of-web-requests/</a><br />
<a href="https://technet.microsoft.com/en-us/library/cc938217.aspx" target="_blank">https://technet.microsoft.com/en-us/library/cc938217.aspx</a></p>
<p>The post <a href="https://www.gembalabs.com/2015/05/20/an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/">An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2015/05/20/an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Using the ASP.Net bundler without minification</title>
		<link>https://www.gembalabs.com/2015/04/20/using-the-asp-net-bundler-without-minification/</link>
					<comments>https://www.gembalabs.com/2015/04/20/using-the-asp-net-bundler-without-minification/#comments</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Mon, 20 Apr 2015 12:26:47 +0000</pubDate>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=396</guid>

					<description><![CDATA[<p>The bundler shipped with ASP.Net works pretty well with minimal configuration. In short, when the debug flag is off the bundler will do a few things for us: Bundle related files into single web response Apply minification transformation such as shortening variable\method names, trimming whitespace, removing comments, etc Add a version token to the querystring</p>
<p>The post <a href="https://www.gembalabs.com/2015/04/20/using-the-asp-net-bundler-without-minification/">Using the ASP.Net bundler without minification</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The bundler shipped with ASP.Net works pretty well with minimal configuration. In short, when the <strong>debug</strong> flag is off the bundler will do a few things for us:</p>
<ul>
<li>Bundle related files into single web response</li>
<li>Apply minification transformation such as shortening variable\method names, trimming whitespace, removing comments, etc</li>
<li>Add a version token to the querystring of the resource filename. It recognizes when a file within a group changes and produces a new token, which will keep our users&#8217; browsers from using cached files.</li>
</ul>
<p>Below is a sample BundleConfig.cs file that defines four javascript bundles and a single css bundle. When debug is turned on, each of the files will be served independently.</p>
<div class="fusion-fullwidth fullwidth-box hundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-8 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;csharp&#8221;]
public class BundleConfig<br />
{<br />
    public static void RegisterBundles(BundleCollection bundles)<br />
    {<br />
        bundles.Add(new ScriptBundle(&quot;~/bundles/jquery&quot;).Include(<br />
                    &quot;~/Scripts/jquery-{version}.js&quot;));</p>
<p>        bundles.Add(new ScriptBundle(&quot;~/bundles/jqueryval&quot;).Include(<br />
                    &quot;~/Scripts/jquery.validate*&quot;));</p>
<p>        bundles.Add(new ScriptBundle(&quot;~/bundles/modernizr&quot;).Include(<br />
                    &quot;~/Scripts/modernizr-*&quot;));</p>
<p>        bundles.Add(new ScriptBundle(&quot;~/bundles/bootstrap&quot;).Include(<br />
                    &quot;~/Scripts/bootstrap.js&quot;,<br />
                    &quot;~/Scripts/respond.js&quot;));</p>
<p>        bundles.Add(new StyleBundle(&quot;~/Content/css&quot;).Include(<br />
                    &quot;~/Content/bootstrap.css&quot;,<br />
                    &quot;~/Content/site.css&quot;));<br />
    }<br />
}[/source]
<p>Let’s turn debug off so we can see the bundler in action.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-9 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;xml&#8221; highlight=&#8221;3&#8243;]
&lt;system.web&gt;<br />
  &lt;authentication mode=&quot;None&quot; /&gt;<br />
  &lt;compilation debug=&quot;false&quot; targetFramework=&quot;4.5&quot; /&gt;<br />
  &lt;httpRuntime targetFramework=&quot;4.5&quot; /&gt;<br />
&lt;/system.web&gt;[/source]
<p>Looking at the Network tab in Chrome&#8217;s developer tools shows that the files are now being minified and loaded from <strong>/bundles/</strong> url paths instead of the physical <strong>/scripts/</strong> path. Also, now <strong>/bundles/boostrap.js</strong> includes the contents of both bootstrap.js and respond.js.</p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic1.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic1.png" alt="Network Traffic" width="926" height="272" class="alignleft size-full wp-image-397" srcset="https://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic1-300x88.png 300w, https://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic1.png 926w" sizes="auto, (max-width: 926px) 100vw, 926px" /></a></p>
<p>Since the minifying process involves rewriting javascript code, it&#8217;s possible that a bug could appear as a result. Luckily, if a particularly nasty bug appears, there are methods available to bypass minification while continuing to take advantage of bundling and versioning.</p>
<p>Our first option is to register our scripts as generic <strong>Bundle</strong> objects instead of <strong>ScriptBundles</strong>. In the sample below, we’ve changed the &#8216;bootstrap&#8217; bundle from a <strong>ScriptBundle</strong> to a regular <strong>Bundle</strong> and we can see that the the bootstrap.js and respond.js files have been merged, but not minified.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-10 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;csharp&#8221; highlight=&#8221;14-16&#8243;]
public class BundleConfig<br />
{<br />
    public static void RegisterBundles(BundleCollection bundles)<br />
    {<br />
        bundles.Add(new ScriptBundle(&quot;~/bundles/jquery&quot;).Include(<br />
                    &quot;~/Scripts/jquery-{version}.js&quot;));</p>
<p>        bundles.Add(new ScriptBundle(&quot;~/bundles/jqueryval&quot;).Include(<br />
                    &quot;~/Scripts/jquery.validate*&quot;));</p>
<p>        bundles.Add(new ScriptBundle(&quot;~/bundles/modernizr&quot;).Include(<br />
                    &quot;~/Scripts/modernizr-*&quot;));</p>
<p>        bundles.Add(new Bundle(&quot;~/bundles/bootstrap&quot;).Include(<br />
                    &quot;~/Scripts/bootstrap.js&quot;,<br />
                    &quot;~/Scripts/respond.js&quot;));</p>
<p>        bundles.Add(new StyleBundle(&quot;~/Content/css&quot;).Include(<br />
                    &quot;~/Content/bootstrap.css&quot;,<br />
                    &quot;~/Content/site.css&quot;));<br />
    }<br />
}[/source]
<p><a href="http://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic2.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic2.png" alt="Network Traffic" width="927" height="261" class="alignleft size-full wp-image-398" srcset="https://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic2-300x84.png 300w, https://www.gembalabs.com/wp-content/uploads/2015/04/NetworkTraffic2.png 927w" sizes="auto, (max-width: 927px) 100vw, 927px" /></a></p>
<p>This approach would allow us to configure minification on a bundle-by-bundle basic. But what if we wanted to disable it site-wide? We can do this by clearing the <strong>Transforms</strong> collection for each bundle after they’re registered in the Global.asax.cs.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-11 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;csharp&#8221; highlight=&#8221;9&#8243;]
public class MvcApplication : System.Web.HttpApplication<br />
{<br />
    protected void Application_Start()<br />
    {<br />
        AreaRegistration.RegisterAllAreas();<br />
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);<br />
        RouteConfig.RegisterRoutes(RouteTable.Routes);<br />
        BundleConfig.RegisterBundles(BundleTable.Bundles);<br />
        BundleTable.Bundles.ForEach(x =&gt; x.Transforms.Clear());<br />
    }<br />
}[/source]
<p>Now all of our javascript resources will continued to be bundled (and versioned), but without going through the minification process!</p>
<h2>Resources</h2>
<p><a href="http://www.asp.net/mvc/overview/performance/bundling-and-minification" target="_blank">Official Documentation</a><br />
<a href="http://www.amazon.com/gp/product/B00LVVUISG/ref=as_li_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B00LVVUISG&#038;linkCode=as2&#038;tag=gembalabs-20&#038;linkId=W4ZWT4IABXWFY3V2">Professional ASP.NET MVC 5</a><img loading="lazy" decoding="async" src="http://ir-na.amazon-adsystem.com/e/ir?t=gembalabs-20&#038;l=as2&#038;o=1&#038;a=B00LVVUISG" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2015/04/20/using-the-asp-net-bundler-without-minification/">Using the ASP.Net bundler without minification</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2015/04/20/using-the-asp-net-bundler-without-minification/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Elasticsearch Tutorial: What is percolation?</title>
		<link>https://www.gembalabs.com/2015/04/15/elasticsearch-tutorial-what-is-percolation/</link>
					<comments>https://www.gembalabs.com/2015/04/15/elasticsearch-tutorial-what-is-percolation/#comments</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Thu, 16 Apr 2015 00:35:51 +0000</pubDate>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[elasticsearch]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=393</guid>

					<description><![CDATA[<p>One of the lesser known features in Elasticsearch search is percolation. It’s commonly referred to as “search in reverse” and it allows you to index queries and, at a later time, percolate a document to find queries that it will match. Sound a bit confusing? It took me a while to wrap my head around</p>
<p>The post <a href="https://www.gembalabs.com/2015/04/15/elasticsearch-tutorial-what-is-percolation/">Elasticsearch Tutorial: What is percolation?</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One of the lesser known features in Elasticsearch search is <strong>percolation</strong>. It’s commonly referred to as <em>“search in reverse”</em> and it allows you to index queries and, at a later time, percolate a document to find queries that it will match. Sound a bit confusing? It took me a while to wrap my head around this feature, but once you understand how it works it’s easy to see just how powerful it can be across a wide range of domains.</p>
<p>For example, imagine:</p>
<ul>
<li>A news aggregator that, instead of restricting user subscriptions to broad categories of content, it allowed them the freedom to be very specific about the type of content they’re interested in. For example, instead of simply following a ‘Sports’ category they subscribe to articles discussing the Cleveland Cavs during the weeks of the playoffs.</li>
<li>A regulation company needing to be notified when specific types of additives are added to our food.</li>
<li>A day trader who wants know when a security within the Tech sector break through their 10-day moving average.</li>
</ul>
<p>To familiarize ourselves with the Percolator, we’re going to walk through a simple example that includes a ‘Library’ index which contains documents of type ‘Book’. The book type mapping has properties describing author, title, categories, and a list of nested locations (which will include availability information).</p>
<div class="fusion-fullwidth fullwidth-box hundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-12 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						<style type='text/css'>.reading-box-container-1 .element-bottomshadow:before,.reading-box-container-1 .element-bottomshadow:after{opacity:0.7;}</style><div class="fusion-reading-box-container reading-box-container-1" style="margin-top:0px;margin-bottom:84px;"><div class="reading-box" style="background-color:#fff;border-width:1px;border-color:#e8e6e6;border-top-width:3px;border-top-color:#a0ce4e;border-style:solid;"><div class="reading-box-description"></p>
<p><strong>NOTE:</strong> The examples throughout this post were created using the Sense tool within the Marvel plugin. The query feature itself makes it worth the 15 seconds it takes to install. But if you use other tools, such as cURL, be sure to add the server and port to the url.</p>
<p>Ex.</p>
<p>CURL -XGET http://localhost:9200/library/book/1</p>
<p></div><div class="fusion-clearfix"></div></div></div>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-13 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
POST library/_mapping/book<br />
{<br />
  &quot;book&quot;:{<br />
    &quot;properties&quot;:{<br />
      &quot;author&quot;:{<br />
        &quot;type&quot;:&quot;string&quot;<br />
      },<br />
      &quot;categories&quot;:{<br />
        &quot;type&quot;:&quot;string&quot;,<br />
        &quot;index&quot;:&quot;not_analyzed&quot;<br />
      },<br />
      &quot;id&quot;:{<br />
        &quot;type&quot;:&quot;integer&quot;<br />
      },<br />
      &quot;locations&quot;:{<br />
        &quot;type&quot;:&quot;nested&quot;,<br />
        &quot;properties&quot;:{<br />
          &quot;availableCopies&quot;:{<br />
            &quot;type&quot;:&quot;integer&quot;<br />
          },<br />
          &quot;name&quot;:{<br />
            &quot;type&quot;:&quot;string&quot;<br />
          }<br />
        }<br />
      },<br />
      &quot;title&quot;:{<br />
        &quot;type&quot;:&quot;string&quot;<br />
      }<br />
    }<br />
  }<br />
}[/source]
<p>Given the above mapping, let’s consider a patron that wants to be notified when any books new books by Vonnegut are added. To do this, we’re going to register a query using the library index’s percolator endpoint. </p>
<p>Note that in the url, we’re specify the new query id, “johns_wishlist”. The message body itself has two parts: the query which includes the match criteria, and a place for storing metadata describing the query. In this example, we’re using the metadata section to store the userid for the person owning this wish list query.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-14 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
POST /library/.percolator/johns_wishlist<br />
{<br />
  &quot;query&quot;:{<br />
    &quot;match&quot;:{<br />
      &quot;author&quot;:&quot;vonnegut&quot;<br />
    },<br />
    &quot;userid&quot;:&quot;1&quot;<br />
  }<br />
}[/source]
<p>It’s awesome to see that, much like documents, queries are also stored in a flexible JSON format.</p>
<p>Now that we have a stored query, let’s percolate a document to see if we can match the query. This involves sending a message with document information to the “_percolate” endpoint. The “doc” property includes the values describing the book.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-15 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
GET library/book/_percolate<br />
{<br />
  &quot;doc&quot;:{<br />
    &quot;title&quot;:&quot;Breakfast of Champions&quot;,<br />
    &quot;author&quot;:&quot;Kurt Vonnegut&quot;<br />
  }<br />
}[/source]
<p>This request would produce the results:</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-16 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;js&#8221;]
{<br />
  &quot;took&quot;:1,<br />
  &quot;_shards&quot;:{<br />
    &quot;total&quot;:5,<br />
    &quot;successful&quot;:5,<br />
    &quot;failed&quot;:0<br />
  },<br />
  &quot;total&quot;:1,<br />
  &quot;matches&quot;:[<br />
    {<br />
      &quot;_index&quot;:&quot;library&quot;,<br />
      &quot;_id&quot;:&quot;johns_wishlist&quot;<br />
    }<br />
  ]
}[/source]
<p>The act of percolating does not add the document itself to the index, that would need to be done as a separate step. We could, however, percolate using existing documents by including the document id in the percolate request.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-17 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;bash&#8221;]
GET library/book/1/_percolate[/source]
<p>The Percolator has several other useful features such as aggregation, sorting, highlighting, and percolating multiple documents at a time. Below are some resources available if you’d like to learn a bit more.</p>
<p><a href="http://www.elastic.co/guide/en/elasticsearch/reference/1.3/search-percolate.html" target="_blank">Official documentation</a> &#8211; Overview of the available configuration options for the percolator. </p>
<p><a href="http://www.amazon.com/gp/product/B00SLXVBC4/ref=as_li_tl?ie=UTF8&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B00SLXVBC4&#038;linkCode=as2&#038;tag=gembalabs-20&#038;linkId=MGF5C7VSOCC5ZCHE">Elasticsearch: The Definitive Guide</a><img loading="lazy" decoding="async" src="http://ir-na.amazon-adsystem.com/e/ir?t=gembalabs-20&#038;l=as2&#038;o=1&#038;a=B00SLXVBC4" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> &#8211; Most of the content covered in this book is available on the documentation site, but the book is better structured for folks (like myself) trying to learn Elasticsearch from start to finish.<div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2015/04/15/elasticsearch-tutorial-what-is-percolation/">Elasticsearch Tutorial: What is percolation?</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2015/04/15/elasticsearch-tutorial-what-is-percolation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Updating Widows Service Bus Runas Password</title>
		<link>https://www.gembalabs.com/2014/04/18/updating-widows-service-bus-runas-password/</link>
					<comments>https://www.gembalabs.com/2014/04/18/updating-widows-service-bus-runas-password/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Fri, 18 Apr 2014 14:28:12 +0000</pubDate>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Windows Service Bus]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=358</guid>

					<description><![CDATA[<p>I'm running a Windows Service Bus 1.1 farm on my local machine for testing, and recently the services stopped working after I updated my system password. The services were configured to run under my user account so needed to be updated after I changed my password. To do so, we'll need to use Service Bus</p>
<p>The post <a href="https://www.gembalabs.com/2014/04/18/updating-widows-service-bus-runas-password/">Updating Widows Service Bus Runas Password</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m running a Windows Service Bus 1.1 farm on my local machine for testing, and recently the services stopped working after I updated my system password. The services were configured to run under my user account so needed to be updated after I changed my password.</p>
<p>To do so, we&#8217;ll need to use Service Bus Powershell.</p>
<p>First, stop any services that by be running.</p>
<pre class="brush: powershell; title: ; notranslate">
Stop-SBFarm
</pre>
<p>Once everything is stopped, we can update the runas password by using a SecureString.</p>
<pre class="brush: powershell; title: ; notranslate">
$pw=ConvertTo-SecureString -AsPlainText -Force -String 'yourpassword'
Update-SBHost -RunAsPassword $pw
</pre>
<p>And last, we just need to restart the farm.</p>
<pre class="brush: powershell; title: ; notranslate">
Start-SBFarm
</pre>
<p>The post <a href="https://www.gembalabs.com/2014/04/18/updating-widows-service-bus-runas-password/">Updating Widows Service Bus Runas Password</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2014/04/18/updating-widows-service-bus-runas-password/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Enabling WCF Trace Log</title>
		<link>https://www.gembalabs.com/2014/04/12/enabling-wcf-trace-log/</link>
					<comments>https://www.gembalabs.com/2014/04/12/enabling-wcf-trace-log/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Sat, 12 Apr 2014 22:37:05 +0000</pubDate>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WCF]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=355</guid>

					<description><![CDATA[<p>The Tracing feature in WCF gives us the ability capture event\message details as calls are made to web services. Enabling this in IIS can be done fairly easily by selecting the Application and clicking the “Configure…” link in the Manage WCF and WF Services section of the Action panel. From there, go the Monitoring section</p>
<p>The post <a href="https://www.gembalabs.com/2014/04/12/enabling-wcf-trace-log/">Enabling WCF Trace Log</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The Tracing feature in WCF gives us the ability capture event\message details as calls are made to web services. Enabling this in IIS can be done fairly easily by selecting the Application and clicking the “Configure…” link in the Manage WCF and WF Services section of the Action panel. From there, go the Monitoring section which will allow you to configure your trace settings. You can also configure this at the website or server level as well.</p>
<p>You can also set this up in your application’s web.config (helpful when running under IIS Express) by adding diagnostic elements to the system.serviceModel and system.webServer sections.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key=&quot;aspnet:UseTaskFriendlySynchronizationContext&quot; value=&quot;true&quot; /&gt;
  &lt;/appSettings&gt;
  &lt;system.web&gt;
    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.5&quot; /&gt;
    &lt;httpRuntime targetFramework=&quot;4.5&quot;/&gt;
  &lt;/system.web&gt;
  &lt;system.serviceModel&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior&gt;
          &lt;serviceMetadata httpGetEnabled=&quot;true&quot; httpsGetEnabled=&quot;true&quot;/&gt;
          &lt;serviceDebug includeExceptionDetailInFaults=&quot;false&quot;/&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;protocolMapping&gt;
        &lt;add binding=&quot;basicHttpsBinding&quot; scheme=&quot;https&quot; /&gt;
    &lt;/protocolMapping&gt;   
    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot;
                               multipleSiteBindingsEnabled=&quot;true&quot; /&gt;
    &lt;diagnostics&gt;
      &lt;messageLogging
        logEntireMessage=&quot;true&quot;
        logMalformedMessages=&quot;true&quot;
        logMessagesAtServiceLevel=&quot;true&quot;
        logMessagesAtTransportLevel=&quot;true&quot;
        maxMessagesToLog=&quot;100000&quot;&gt;
      &lt;/messageLogging&gt;
    &lt;/diagnostics&gt;
  &lt;/system.serviceModel&gt;
  &lt;system.webServer&gt;
    &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;/&gt;
    &lt;directoryBrowse enabled=&quot;true&quot;/&gt;
  &lt;/system.webServer&gt;
  &lt;system.diagnostics&gt;
    &lt;sharedListeners&gt;
      &lt;add name=&quot;SharedServiceListener&quot;
           type=&quot;System.Diagnostics.XmlWriterTraceListener&quot;
           initializeData=&quot;C:\Temp\ServiceTraceLog.svclog&quot;&gt;&lt;/add&gt;
    &lt;/sharedListeners&gt;
    &lt;sources&gt;
      &lt;source name=&quot;System.ServiceModel&quot; switchValue=&quot;Verbose&quot;&gt;
        &lt;listeners&gt;
          &lt;add name=&quot;SharedServiceListener&quot;&gt;&lt;/add&gt;
        &lt;/listeners&gt;
      &lt;/source&gt;
      &lt;source name=&quot;System.ServiceModel.MessageLogging&quot; switchValue=&quot;Verbose&quot;&gt;
        &lt;listeners&gt;
          &lt;add name=&quot;SharedServiceListener&quot;&gt;&lt;/add&gt;
        &lt;/listeners&gt;
      &lt;/source&gt;
    &lt;/sources&gt;
  &lt;/system.diagnostics&gt;
&lt;/configuration&gt;
</pre>
<p>The post <a href="https://www.gembalabs.com/2014/04/12/enabling-wcf-trace-log/">Enabling WCF Trace Log</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2014/04/12/enabling-wcf-trace-log/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Reverse engineer database to custom Code First entity model and mappings</title>
		<link>https://www.gembalabs.com/2014/03/20/reverse-engineer-database-custom-code-first-entity-model-mappings/</link>
					<comments>https://www.gembalabs.com/2014/03/20/reverse-engineer-database-custom-code-first-entity-model-mappings/#respond</comments>
		
		<dc:creator><![CDATA[John Miller]]></dc:creator>
		<pubDate>Fri, 21 Mar 2014 00:24:22 +0000</pubDate>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://www.gembalabs.com/?p=332</guid>

					<description><![CDATA[<p>It's really cool to see how far code-first support within Entity Framework has come over the last few releases. It's extremely freeing to be create our own POCOs and custom mapping classes, which nostalgically remind of past projects with FluentNHibernate. And we aren't tied down to edmx files (and nasty merge conflicts that come with</p>
<p>The post <a href="https://www.gembalabs.com/2014/03/20/reverse-engineer-database-custom-code-first-entity-model-mappings/">Reverse engineer database to custom Code First entity model and mappings</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s really cool to see how far code-first support within Entity Framework has come over the last few releases. It&#8217;s extremely freeing to be create our own POCOs and custom mapping classes, which nostalgically remind of past projects with FluentNHibernate. And we aren&#8217;t tied down to edmx files (and nasty merge conflicts that come with them)!</p>
<p>With that freedom comes a bit of extra responsibility on our part…meaning we have to actually create those POCOs, mappers, and DbContext classes.  It turns out, the Entity Framework team has created some tools to make that work a bit easier for us if we already have a database schema in place. The latest release of EF Power Tools includes a &#8216;Reverse Engineer Code First&#8217; utility to generate these initial classes.</p>
<p>First, we need to install the latest version of the EF Power Tools VS extension using the Tools &#8211;> Extensions and Updates menu item within Visual Studio.</p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-install.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-install.png" alt="EF Power Tools install" width="500" height="337" class="alignnone size-large wp-image-347" srcset="https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-install-300x202.png 300w, https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-install.png 1000w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a></p>
<p>After installing, projects will have two new context menu items available within Visual Studio.</p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-Project-Context-Options.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-Project-Context-Options.png" alt="EF Power Tools Project Context Options" width="666" height="201" class="alignnone size-large wp-image-348" srcset="https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-Project-Context-Options-300x90.png 300w, https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Power-Tools-Project-Context-Options.png 999w" sizes="auto, (max-width: 666px) 100vw, 666px" /></a></p>
<p><strong>Reverse Engineer Code First</strong> &#8211; Given a database connection, creates the related models, mappers, and db context classes.<br />
<strong>Customize Reverse Engineer Templates</strong> &#8211; Allows you to tailor the generation of these classes.</p>
<p>Let&#8217;s begin by reverse engineering a simple BookStore database containing two tables: Authors and Books. Upon selecting, we&#8217;re asked for database connection information which, once entered, will be used to generate those classes. </p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Database-Connection.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Database-Connection.png" alt="EF Database Connection" width="405" height="666" class="alignnone size-full wp-image-346" /></a></p>
<p>Depending on the size of your database, this step could take up to a couple minutes. Below are the classes generated.</p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Solution-Explorer.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-Solution-Explorer.png" alt="EF Solution Explorer" width="354" height="320" class="alignnone size-large wp-image-349" srcset="https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Solution-Explorer-300x271.png 300w, https://www.gembalabs.com/wp-content/uploads/2014/03/EF-Solution-Explorer.png 708w" sizes="auto, (max-width: 354px) 100vw, 354px" /></a></p>
<p>Let&#8217;s take a look at one of the mappers.</p>
<div class="fusion-fullwidth fullwidth-box hundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-18 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;csharp&#8221;]
public class BookMap : EntityTypeConfiguration&lt;Book&gt;<br />
{<br />
    public BookMap()<br />
    {<br />
        // Primary Key<br />
        this.HasKey(t =&gt; t.Id);</p>
<p>        // Properties<br />
        this.Property(t =&gt; t.Title)<br />
            .IsRequired()<br />
            .HasMaxLength(50);</p>
<p>        // Table &amp; Column Mappings<br />
        this.ToTable(&quot;Books&quot;);<br />
        this.Property(t =&gt; t.Id).HasColumnName(&quot;Id&quot;);<br />
        this.Property(t =&gt; t.Title).HasColumnName(&quot;Title&quot;);<br />
        this.Property(t =&gt; t.AuthorId).HasColumnName(&quot;AuthorId&quot;);</p>
<p>        // Relationships<br />
        this.HasRequired(t =&gt; t.Author)<br />
            .WithMany(t =&gt; t.Books)<br />
            .HasForeignKey(d =&gt; d.AuthorId);<br />
    }<br />
}[/source]
<p>The generated code isn&#8217;t bad, but I&#8217;d like it to be a little cleaner. Luckily, we can modify how these are created by tweaking the T4 templates used to generate our model. The remaining cleanup can be done using Resharper.  Let&#8217;s delete the Models folder and start over. </p>
<p>Right-click the VS project and select Entity Framework &#8211;> Customize Reverse Engineer Templates. If you receive the following prompt, click OK.</p>
<p><a href="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-warning.png"><img loading="lazy" decoding="async" src="http://www.gembalabs.com/wp-content/uploads/2014/03/EF-warning.png" alt="EF warning" width="500" height="182" class="alignnone size-large wp-image-350" srcset="https://www.gembalabs.com/wp-content/uploads/2014/03/EF-warning-300x109.png 300w, https://www.gembalabs.com/wp-content/uploads/2014/03/EF-warning.png 999w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a></p>
<p>Open Solution Explorer, and you should see the following T4 templates added to the project. (You can ignore the errors that VS says exists in the templates, they won&#8217;t actually stop the project from building…and we&#8217;ll be deleting the templates after generating our model).</p>
<p>I made the following changes to the generated templates:</p>
<ul>
<li>Removed &#8216;partial&#8217; keyword from entity and context classes</li>
<li>Removed &#8216;this&#8217; qualifier throughout</li>
<li>Combined property mapping configuration</li>
</ul>
<p>Now, we can run the Reverse Engineer tool again and this time we&#8217;ll get a slightly cleaner BookMap class.</p>
<div class="fusion-clearfix"></div>

					</div>
				</div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-19 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height 1_1"  style='margin-top:0px;margin-bottom:0px;'>
					<div class="fusion-column-wrapper" style="background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"   data-bg-url="">
						[source language=&#8221;csharp&#8221;]
public class BookMap : EntityTypeConfiguration&lt;Book&gt;<br />
{<br />
    public BookMap()<br />
    {<br />
        HasKey(t =&gt; t.Id);<br />
        ToTable(&quot;Books&quot;);</p>
<p>        Property(t =&gt; t.Id)<br />
            .HasColumnName(&quot;Id&quot;);</p>
<p>        Property(t =&gt; t.Title)<br />
            .HasColumnName(&quot;Title&quot;)<br />
            .IsRequired()<br />
            .HasMaxLength(50);</p>
<p>        Property(t =&gt; t.AuthorId)<br />
            .HasColumnName(&quot;AuthorId&quot;);</p>
<p>        HasRequired(t =&gt; t.Author)<br />
            .WithMany(t =&gt; t.Books)<br />
            .HasForeignKey(d =&gt; d.AuthorId);<br />
    }<br />
}[/source]
<p>We didn&#8217;t do it here, but we could have modified the templates for other reasons as well. For example, we could have made all of our entities (or mappers) inherit from a common base class. Or we could have appended a &#8216;Dto&#8217; suffix to the end of our model classes.</p>
<p>These templates are available on github.<br />
<a href="https://github.com/johnmiller/ReverseEngineerCodeFirstT4Templates">https://github.com/johnmiller/ReverseEngineerCodeFirstT4Templates</a><div class="fusion-clearfix"></div>

					</div>
				</div></div></div>
<p>The post <a href="https://www.gembalabs.com/2014/03/20/reverse-engineer-database-custom-code-first-entity-model-mappings/">Reverse engineer database to custom Code First entity model and mappings</a> appeared first on <a href="https://www.gembalabs.com">Gemba Labs</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gembalabs.com/2014/03/20/reverse-engineer-database-custom-code-first-entity-model-mappings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
